#include "stm8l10x.h"


void hal_TIM4_Config()
{
  /* Enable TIM4 CLK */
  CLK_PeripheralClockConfig(CLK_Peripheral_TIM4, ENABLE);
  
  TIM4_DeInit();
  
  /* Time base configuration */ 
  TIM4_TimeBaseInit(TIM4_Prescaler_64, 250);
  TIM4_ITConfig(TIM4_IT_Update, ENABLE);
  
  //enableInterrupts();

  /* Initialize I/Os in Output Mode */
  GPIO_Init(GPIOA, GPIO_Pin_3, GPIO_Mode_Out_PP_Low_Fast);

  /* Enable TIM4 */
  TIM4_Cmd(ENABLE);
}


  